<template>
  <view @click="handleClick">
    <slot></slot>
  </view>
</template>

<script>
export default {
  props: {
    list: {
      type: Array,
      default() {
        return []
      }
    },
    index: {
      type: Number,
      default: 0
    }
  },
  data() {
    return {}
  },
  methods: {
    handleClick() {
      getApp().globalData.imgIndex = this.index
      getApp().globalData.imgList = this.list
      uni.navigateTo({
        url: '/pages/imgDetail/index'
      })
    }
  }
}
</script>

<style scoped>
</style>